As a technique for calculating the position of a moving object by comparing a three-dimensional map and an image captured by a camera, there has been known a technique described in Japanese Patent Application Publication No. 2009-199572, for example. In Japanese Patent Application Publication No. 2009-199572, first, an edge image is created by extracting edges from an actual video image obtained by an in-vehicle camera installed in a vehicle. A virtual image is created in which a three-dimensional map is projected from the position and at the attitude of the in-vehicle camera, the three-dimensional map including three-dimensional data where the positions and shapes of edges of surroundings are recorded. Then, the position and attitude angle of the in-vehicle camera are adjusted so that the edge image and the virtual image can match each other. In this way, the position and attitude angle of the in-vehicle camera in a three-dimensional space are estimated.
However, in Japanese Patent Application Publication No. 2009-199572, even when an actual video image matches a virtual image, there may be a large error in the position of the in-vehicle camera if the matching place is distant from the in-vehicle camera. On the other hand, if the matching position is near the in-vehicle camera, there may be a large error in the attitude angle of the in-vehicle camera.